Skip to content

fix: apply HTTP restrictions to the SageMaker endpoint - #8686

Merged
mattwittwer merged 11 commits into
mainfrom
mwittwer/sagemaker_input_size_limit
Mar 11, 2026
Merged

fix: apply HTTP restrictions to the SageMaker endpoint#8686
mattwittwer merged 11 commits into
mainfrom
mwittwer/sagemaker_input_size_limit

Conversation

@mattwittwer

@mattwittwer mattwittwer commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

What does the PR do?

Implement the core HTTP server’s restricted API and max input size settings in the SageMaker endpoint.

Add regression testing for restricted operations and payload-size enforcement for the Sagemaker endpoint.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs:

Where should the reviewer start?

The main changes to pass these parameters are in:
src/main.cc
src/sagemaker_server.h

Then the implementation for the restricted endpoint checks is in:
src/sagemaker_server.cc

Test plan:

  • CI Pipeline ID:

45550957

Caveats:

Background

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

@mattwittwer mattwittwer self-assigned this Mar 6, 2026
@mattwittwer mattwittwer changed the title draft: limit sagemaker input size fix: apply HTTP restrictions to the SageMaker endpoint Mar 6, 2026
whoisj
whoisj previously approved these changes Mar 9, 2026

@whoisj whoisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/sagemaker_server.cc Outdated
if (multi_model_name.empty()) {
LOG_VERBOSE(1) << "SageMaker request: LIST ALL MODELS";

if (restricted_apis_.IsRestricted(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should create a new macro similar to RETURN_AND_RESPOND_IF_RESTRICTED

Comment thread qa/L0_sagemaker/test.sh
@mattwittwer
mattwittwer merged commit a5b45da into main Mar 11, 2026
3 checks passed
@mattwittwer
mattwittwer deleted the mwittwer/sagemaker_input_size_limit branch March 11, 2026 22:42
mattwittwer added a commit that referenced this pull request Mar 11, 2026
@yinggeh

yinggeh commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

This should be feat

LinZiyuu added a commit to LinZiyuu/server that referenced this pull request May 30, 2026
The SageMaker multi-model custom-invoke route (POST /models/{model}/invoke)
is dispatched to SageMakerMMEHandleInfer() without checking the inference
API restriction. When --http-restricted-api=inference is configured, the
standard HTTP infer, the gRPC infer, and the SageMaker /invocations routes
all enforce the required header (the last via the inherited HandleInfer),
but the MME invoke route runs inference without it. This mirrors the MME
model-repository gap closed in triton-inference-server#8686, which did not cover the invoke route.

Add the existing RETURN_AND_RESPOND_IF_RESTRICTED(req,
RestrictedCategory::INFERENCE) guard at the top of the /invoke branch,
matching the base HandleInfer/HandleGenerate handlers and the sibling MME
repository branches. No behavior change when no inference restriction is set.

Signed-off-by: LinZiyuu <linziyu0205@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants